package com.csyaonie.android;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class LifeCycleActivity extends AppCompatActivity {

    private static final String TAG = "LifeCycleActivity";

    private Button d_bt;
    private Button n_bt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_life_cycle);
        d_bt=findViewById(R.id.d_bt);
        n_bt=findViewById(R.id.n_bt);

        d_bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(LifeCycleActivity.this,DialogActivity.class);
                startActivity(intent);
            }
        });

        n_bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(LifeCycleActivity.this,ImageViewActivity.class);
                startActivity(intent);
            }
        });

        Log.d("LifeCycle","---onCreate---");
        Log.d(TAG, "onCreate: run");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d("LifeCycle","---onStart---");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d("LifeCycle","---onResume---");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d("LifeCycle","---onPause---");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d("LifeCycle","---onStop---");
    }

    @Override
    protected void onRestart() {
        super.onRestart();
        Log.d("LifeCycle","---onRestart---");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d("LifeCycle","---onDestroy---");
    }
}